{% extends "mall_base.html" %}
{% block title %}
    <title>我的购物车</title>
{% endblock %}

{% block content %}
{#我的购物车界面#}
<div class="container">
    <div class="row">
        <div class="col-md-12">
            <h1>购物车列表</h1>

            <table class="table table-bordered">
                <tr>
                    <th>商品名称</th>
                    <th>商品图片</th>
                    <th>商品价格</th>
                    <th>商品数量</th>
                    <th>操作</th>
                </tr>
                {% for orderitem in order_goods_list %}
                    {% for item in goods_list %}
                        {% if item.id == orderitem.goods_id %}
                <tr>
                    <td>{{ item.name }}</td>
                    <td><img src="{{ item.picture }}" width="100px" height="100px"></td>
                    <td>{{ item.price }}￥</td>
                    <td>{{ orderitem.number }}</td>
                    <td>
                        <a href="/cart/remove/{{ orderitem.id }}">从购物车删除</a>
                    </td>
                </tr>
                        {% endif %}
                        {% endfor %}
                {% endfor %}
{#            展示总价#}
                <tr>
                    <td colspan="5" style="text-align: right">
                        总价：{{ order.total_price }}￥
                    </td>
                </tr>

                <tr>
                    <td colspan="5" style="text-align: right">
                        <a href="/order/confirm">结账</a>
                    </td>
                </tr>

            </table>
        </div>
    </div>
</div>

{% endblock %}